gtk4.git
5 years agolabel: Optimize GtkLabel setters
Matthias Clasen [Wed, 11 Nov 2020 15:35:09 +0000 (10:35 -0500)]
label: Optimize GtkLabel setters

The overarching goal here is to not queue a resize
unless something has actually changed. In columnview
scenarios, we often deal with hundreds of labels.

Labels are cattle, not pets.

5 years agogtk-demo: Split off SvgPaintable
Matthias Clasen [Tue, 10 Nov 2020 21:12:16 +0000 (16:12 -0500)]
gtk-demo: Split off SvgPaintable

Put the SvgPaintable implementation into its
own source files, for ease of copying.

5 years agoDon't hide widgets in dispose()
Matthias Clasen [Tue, 10 Nov 2020 20:07:07 +0000 (15:07 -0500)]
Don't hide widgets in dispose()

This is leftover code from when widgets were hidden
by default, and was setting them back to their initial
state.

This is getting in the way now, as hiding the widget
updates the HIDDEN accessible state, which ends up
re-creating the at context that we've already disposed
of, leading to memory leaks.

5 years agoMerge branch 'matthiasc/builder-requires' into 'master'
Matthias Clasen [Wed, 11 Nov 2020 03:53:52 +0000 (03:53 +0000)]
Merge branch 'matthiasc/builder-requires' into 'master'

Matthiasc/builder requires

See merge request GNOME/gtk!2806

5 years agoMerge branch 'fix-demos-wo-pangoft2' into 'master'
Matthias Clasen [Wed, 11 Nov 2020 03:50:46 +0000 (03:50 +0000)]
Merge branch 'fix-demos-wo-pangoft2' into 'master'

gtk-demo: Fix building scrolling demo without PangoFT2

See merge request GNOME/gtk!2807

5 years agogtk-demo: Fix building scrolling demo without PangoFT2
Chun-wei Fan [Wed, 11 Nov 2020 03:08:38 +0000 (11:08 +0800)]
gtk-demo: Fix building scrolling demo without PangoFT2

For builds that do not have PangoFT2, the demo fails to link because we weren't
building listview_ucd.c.  Fix the build by building listview_ucd.c with
script-names.c and unicode-names.c for all builds, as we now require a Pango
version that already always depends on HarfBuzz and those sources do not use
anything from PangoFT2.

5 years agotestsuite: Update buildertool tests
Matthias Clasen [Wed, 11 Nov 2020 00:20:51 +0000 (19:20 -0500)]
testsuite: Update buildertool tests

gtk-builder-tool simplify --3to4 now produces a
<requires lib="gtk" version="4.0"/>.
Adapt for that, and also add some tests that check that we
actually verify the requires, and accept 3.99 and 4.0, but
not 5.x.

5 years agobuildertool: Supplant a requires
Matthias Clasen [Wed, 11 Nov 2020 00:19:40 +0000 (19:19 -0500)]
buildertool: Supplant a requires

When we convert a ui file to GTK 4 syntax, we *know*
that it requires GTK 4, so put that in the output.

5 years agobuilder: Be a bit more strict about requires
Matthias Clasen [Wed, 11 Nov 2020 00:18:26 +0000 (19:18 -0500)]
builder: Be a bit more strict about requires

Check that the major version matches (without this, the
requires check is really toothless), but allow 3.99 to
match 4.0.

5 years agotestsuite: Remove <requires> from ui files
Matthias Clasen [Wed, 11 Nov 2020 00:17:45 +0000 (19:17 -0500)]
testsuite: Remove <requires> from ui files

We don't need these here, the testsuite is shipped
with GTK.

5 years agoexamples: Remove requires from ui files
Matthias Clasen [Tue, 10 Nov 2020 23:38:54 +0000 (18:38 -0500)]
examples: Remove requires from ui files

No need to check requires for things that are shipped
with GTK.

5 years agogtk4-demo: Remove <requires> from ui files
Matthias Clasen [Tue, 10 Nov 2020 23:37:40 +0000 (18:37 -0500)]
gtk4-demo: Remove <requires> from ui files

No need to check requires for things that are shipped
with GTK.

5 years agogtk: Remove <requires> from ui files
Matthias Clasen [Tue, 10 Nov 2020 23:36:03 +0000 (18:36 -0500)]
gtk: Remove <requires> from ui files

We don't need to check requirements for things
that are shipped *with* gtk.

5 years agoMerge branch 'ebassi/for-master' into 'master'
Matthias Clasen [Tue, 10 Nov 2020 18:33:36 +0000 (18:33 +0000)]
Merge branch 'ebassi/for-master' into 'master'

Ebassi/for master

Closes #3343 and #3342

See merge request GNOME/gtk!2804

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Tue, 10 Nov 2020 16:59:47 +0000 (16:59 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

See merge request GNOME/gtk!2805

5 years agodocs: Add example of relations with lists of references
Emmanuele Bassi [Tue, 10 Nov 2020 14:38:09 +0000 (14:38 +0000)]
docs: Add example of relations with lists of references

5 years agoa11y: Clone GtkATContext in GtkModelButton
Emmanuele Bassi [Tue, 10 Nov 2020 14:21:32 +0000 (14:21 +0000)]
a11y: Clone GtkATContext in GtkModelButton

The hypothetical widget that needs to clone ATContext instances
because it needs to control the accessible role post-construction is
really GtkModelButton.

Fixes: #3342
5 years agoa11y: Add private API to clone a GtkATContext
Emmanuele Bassi [Tue, 10 Nov 2020 14:19:32 +0000 (14:19 +0000)]
a11y: Add private API to clone a GtkATContext

Some widgets might want to override GtkAccessible and create their own
context in order to control the accessible role post-construction time.
To avoid explicitly copying the existing state over from the original
ATContext to the new one, we need a way to clone the context's state
from inside the ATContext itself.

5 years agoa11y: Do not copy the list of references
Emmanuele Bassi [Tue, 10 Nov 2020 14:17:11 +0000 (14:17 +0000)]
a11y: Do not copy the list of references

The constructor for GtkReferenceListAccessibleValue is transfer full,
which means we should not be copying the GList around.

Fixes: #3343
5 years agoa11y: Parse reference lists using varargs
Emmanuele Bassi [Tue, 10 Nov 2020 14:14:47 +0000 (14:14 +0000)]
a11y: Parse reference lists using varargs

Using GList is a bit lame, and makes the API more complicated to use
than necessary in the common case.

The only real use case for a GList is gtk_widget_add_mnemonic_label(),
and for that we can use the GValue-based API instead.

Fixes: #3343
5 years agoa11y: Add GValue initializers for accessible attributes
Emmanuele Bassi [Tue, 10 Nov 2020 14:08:16 +0000 (14:08 +0000)]
a11y: Add GValue initializers for accessible attributes

Consumers of the GValue-based API for GtkAccessible need to have a way
to initialize the GValue with the correct type for the given attribute.

5 years agoa11y: Proxy GtkWidget:accessible-role
Emmanuele Bassi [Tue, 10 Nov 2020 11:02:35 +0000 (11:02 +0000)]
a11y: Proxy GtkWidget:accessible-role

The accessible-role property in GtkWidget has three possible targets:

 - the :accessible-role of a GtkATContext, if realized
 - the accessible_role field of GtkWidgetPrivate
 - the accessible_role field of GtkWidgetClassPrivate

When we set the accessible role of a widget using the GObject property
mechanism, we want to either set the GtkWidgetPrivate.accessible_role
field, if there's no ATContext *or* if the ATContext is not realized.
Conversely, when we get the accessible-role property we want to have a
series of fallbacks in place:

 - if GtkAccessible.get_at_context() returns an ATContext, and that
   ATContext is realized, return the :accessible-role of the context
 - if GtkWidgetPrivate.accessible_role is not WIDGET, return the
   stored accessible role
 - return GtkWidgetClassPrivate.accessible_role

This should help catch the case of getting the accessible role of
widgets that override GtkAccessible.get_at_context(), like
GtkModelButton.

See: #3342

5 years agoprintdialog: Plug listmodel memory leaks
Matthias Clasen [Tue, 10 Nov 2020 14:07:54 +0000 (09:07 -0500)]
printdialog: Plug listmodel memory leaks

We were leaking references returned from g_list_model_get_item
in some places.

5 years agofontchooser: Plug listmodel memory leaks
Matthias Clasen [Tue, 10 Nov 2020 14:07:40 +0000 (09:07 -0500)]
fontchooser: Plug listmodel memory leaks

We were leaking references returned from g_list_model_get_item
in some places.

5 years agocolumnview: Plug listmodel memory leaks
Matthias Clasen [Tue, 10 Nov 2020 14:07:22 +0000 (09:07 -0500)]
columnview: Plug listmodel memory leaks

We were leaking references returned from g_list_model_get_item
in some places.

5 years agox11: Plug listmodel memory leaks
Matthias Clasen [Tue, 10 Nov 2020 14:07:01 +0000 (09:07 -0500)]
x11: Plug listmodel memory leaks

We were leaking references returned from g_list_model_get_item
in some places.

5 years agowin32: Plug listmodel memory leaks
Matthias Clasen [Tue, 10 Nov 2020 14:06:37 +0000 (09:06 -0500)]
win32: Plug listmodel memory leaks

We were leaking references returned from g_list_model_get_item
in some places.

5 years agowayland: Plug listmodel memory leaks
Matthias Clasen [Tue, 10 Nov 2020 14:05:55 +0000 (09:05 -0500)]
wayland: Plug listmodel memory leaks

We were leaking references returned from g_list_model_get_item
in some places.

5 years agoUpdate Ukrainian translation
Yuri Chornoivan [Tue, 10 Nov 2020 08:15:59 +0000 (08:15 +0000)]
Update Ukrainian translation

5 years agoUpdate Ukrainian translation
Yuri Chornoivan [Tue, 10 Nov 2020 07:58:38 +0000 (07:58 +0000)]
Update Ukrainian translation

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Tue, 10 Nov 2020 04:47:28 +0000 (04:47 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

See merge request GNOME/gtk!2803

5 years agogtk-demo: Plug a memory leak
Matthias Clasen [Tue, 10 Nov 2020 02:04:52 +0000 (21:04 -0500)]
gtk-demo: Plug a memory leak

5 years agogtk-demo: Tweak a demo title
Matthias Clasen [Tue, 10 Nov 2020 01:07:09 +0000 (20:07 -0500)]
gtk-demo: Tweak a demo title

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Tue, 10 Nov 2020 01:42:30 +0000 (01:42 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

See merge request GNOME/gtk!2802

5 years agogkt-demo: Add a columview to the scroll demo
Matthias Clasen [Tue, 10 Nov 2020 01:07:09 +0000 (20:07 -0500)]
gkt-demo: Add a columview to the scroll demo

This is an interesting case, since it has many labels,
and we are struggling to provide good scrolling performance.

5 years agogtk-demo: Improve consistency
Matthias Clasen [Tue, 10 Nov 2020 00:54:17 +0000 (19:54 -0500)]
gtk-demo: Improve consistency

Make the shortcut triggers demo big enough
to not ellipsize the window title.

5 years agogtk-demo: Improve consistency
Matthias Clasen [Tue, 10 Nov 2020 00:53:44 +0000 (19:53 -0500)]
gtk-demo: Improve consistency

Make the paintable svg demo follow the same
pattern we use for other demos.

5 years agogtk-demo: Improve consistency
Matthias Clasen [Tue, 10 Nov 2020 00:52:28 +0000 (19:52 -0500)]
gtk-demo: Improve consistency

Make the paintable emblems demo follow the same
pattern we use for other demos.

5 years agogtk-demo: Set default size for drawingarea demo
Matthias Clasen [Mon, 9 Nov 2020 23:50:43 +0000 (18:50 -0500)]
gtk-demo: Set default size for drawingarea demo

Set a default size, so we don't ellipsize the window
title when the window is presented.

5 years agogtk-demo: Plug a memory leak
Matthias Clasen [Mon, 9 Nov 2020 18:03:01 +0000 (13:03 -0500)]
gtk-demo: Plug a memory leak

5 years agogtk-demo: Plug a memory leak
Matthias Clasen [Mon, 9 Nov 2020 18:02:43 +0000 (13:02 -0500)]
gtk-demo: Plug a memory leak

5 years agoa11y: Clean up properly in unregister_object
Matthias Clasen [Mon, 9 Nov 2020 19:38:55 +0000 (14:38 -0500)]
a11y: Clean up properly in unregister_object

Things that are set up in register_object should
be cleaned up in unregister_object.

5 years agoMerge branch 'wip/jimmac/search-entry-icon' into 'master'
Matthias Clasen [Mon, 9 Nov 2020 22:41:41 +0000 (22:41 +0000)]
Merge branch 'wip/jimmac/search-entry-icon' into 'master'

search entry: icon

Closes #3340

See merge request GNOME/gtk!2801

5 years agosearch entry: icon
Jakub Steiner [Mon, 9 Nov 2020 21:55:21 +0000 (22:55 +0100)]
search entry: icon

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3340

5 years agoMerge branch 'ebassi/for-master' into 'master'
Matthias Clasen [Mon, 9 Nov 2020 17:19:12 +0000 (17:19 +0000)]
Merge branch 'ebassi/for-master' into 'master'

docs: Add missing a11y environment variables

See merge request GNOME/gtk!2788

5 years agoMerge branch 'kinetic-scroll-velocity-accumulation' into 'master'
Matthias Clasen [Mon, 9 Nov 2020 17:14:03 +0000 (17:14 +0000)]
Merge branch 'kinetic-scroll-velocity-accumulation' into 'master'

scrolledwindow: Accumulate velocity with kinetic scrolling

See merge request GNOME/gtk!2768

5 years agoa11y: Consolidate accessibility environment variables
Emmanuele Bassi [Sat, 7 Nov 2020 12:50:11 +0000 (12:50 +0000)]
a11y: Consolidate accessibility environment variables

Use a single environment variable for everything:

 - select the ATContext implementation
 - select the test ATContext
 - disable ATContext entirely

We use the same pattern as GSK_RENDERER, GTK_DEBUG, etc.

The documentation needs to be updated to include the environment
variable.

5 years agoscrolledwindow: Accumulate velocity with kinetic scrolling
Chris Lord [Fri, 30 Oct 2020 18:36:53 +0000 (18:36 +0000)]
scrolledwindow: Accumulate velocity with kinetic scrolling

Accumulate existing velocity when decelerating from a swipe if the swipe
velocity is above a certain fraction of that existing velocity.

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Mon, 9 Nov 2020 14:21:26 +0000 (14:21 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

Closes #3337

See merge request GNOME/gtk!2799

5 years agoRemove GtkPlacesOpenFlags from public headers
Matthias Clasen [Sun, 8 Nov 2020 15:40:20 +0000 (10:40 -0500)]
Remove GtkPlacesOpenFlags from public headers

The GtkPlacesOpenFlags enum is only used in private
API, so move it to private headers. Since we still need
a GType for it, add gtkplacessidebarprivate.h to the
headers we use for generating private enum types. In turn,
this registers the other private enums in that header, so
take the opportunity to fix their naming, and use the
generated types for the corresponding sidebarrow properties.

Fixes: #3337
5 years agodocs: Document GTK_MEDIA
Matthias Clasen [Sun, 8 Nov 2020 14:58:26 +0000 (09:58 -0500)]
docs: Document GTK_MEDIA

Add a paragraph about the GTK_MEDIA environment variable.

5 years agoRevert "Update gtktreestore.c: gtk_tree_store_remove didn't have the proper comment...
Matthias Clasen [Sun, 8 Nov 2020 02:36:34 +0000 (21:36 -0500)]
Revert "Update gtktreestore.c: gtk_tree_store_remove didn't have the proper comment annotation"

This reverts commit 32baa0a54990abec3c60deb0ee8008fbbfc9a809.

See discussion in https://gitlab.gnome.org/GNOME/gtk/-/issues/78
for the background.

5 years agoMerge branch 'patch-3' into 'master'
Matthias Clasen [Sun, 8 Nov 2020 01:11:26 +0000 (01:11 +0000)]
Merge branch 'patch-3' into 'master'

gtk/gtktextbuffer: remove GtkTextBufferTargetInfo

See merge request GNOME/gtk!2797

5 years agoMerge branch 'patch-4' into 'master'
Emmanuele Bassi [Sun, 8 Nov 2020 00:50:40 +0000 (00:50 +0000)]
Merge branch 'patch-4' into 'master'

gtk/gtkversion: fix doc comment references

See merge request GNOME/gtk!2798

5 years agogtk/gtkversion: fix doc comment references
David Lechner [Sat, 7 Nov 2020 23:57:13 +0000 (23:57 +0000)]
gtk/gtkversion: fix doc comment references

Cross-references for constants use the "%" prefix rather than the "#" prefix.

5 years agogtk/gtktextbuffer: remove GtkTextBufferTargetInfo
David Lechner [Sat, 7 Nov 2020 22:29:11 +0000 (22:29 +0000)]
gtk/gtktextbuffer: remove GtkTextBufferTargetInfo

GtkTextBufferTargetInfo is not used anywhere and can be removed.

5 years agoMerge branch 'patch-6' into 'master'
Emmanuele Bassi [Sat, 7 Nov 2020 22:19:33 +0000 (22:19 +0000)]
Merge branch 'patch-6' into 'master'

gtk/enums: remove GtkPopoverConstraint

See merge request GNOME/gtk!2796

5 years agoMerge branch 'patch-4' into 'master'
Emmanuele Bassi [Sat, 7 Nov 2020 22:01:33 +0000 (22:01 +0000)]
Merge branch 'patch-4' into 'master'

doc: fix missing GtkNotebookTab

See merge request GNOME/gtk!2794

5 years agoMerge branch 'patch-5' into 'master'
Emmanuele Bassi [Sat, 7 Nov 2020 21:59:04 +0000 (21:59 +0000)]
Merge branch 'patch-5' into 'master'

gtk/enums: remove GtkMenuDirectionType

Closes #3336

See merge request GNOME/gtk!2795

5 years agogtk/enums: remove GtkPopoverConstraint
David Lechner [Sat, 7 Nov 2020 21:47:32 +0000 (21:47 +0000)]
gtk/enums: remove GtkPopoverConstraint

GtkPopoverConstraint is no longer used anywhere and can be removed.

5 years agogtk/enums: remove GtkMenuDirectionType
David Lechner [Sat, 7 Nov 2020 21:39:34 +0000 (21:39 +0000)]
gtk/enums: remove GtkMenuDirectionType

This was used by GtkMenu and can safely be removed.

Closes #3336

5 years agoMerge branch 'gles-no-queries' into 'master'
Emmanuele Bassi [Sat, 7 Nov 2020 21:33:09 +0000 (21:33 +0000)]
Merge branch 'gles-no-queries' into 'master'

gl renderer: Generate queries only on desktop GL

See merge request GNOME/gtk!2792

5 years agoMerge branch 'patch-3' into 'master'
Emmanuele Bassi [Sat, 7 Nov 2020 21:32:40 +0000 (21:32 +0000)]
Merge branch 'patch-3' into 'master'

docs: include GtkFilterMatch

See merge request GNOME/gtk!2793

5 years agodoc: fix missing GtkNotebookTab
David Lechner [Sat, 7 Nov 2020 21:17:09 +0000 (21:17 +0000)]
doc: fix missing GtkNotebookTab

GtkNotebookTab was listed under private, but it is used by the "focus-tab" signal, so it needs to be public.

5 years agogl renderer: Generate queries only on desktop GL
Emmanuel Gil Peyrot [Sat, 7 Nov 2020 20:14:07 +0000 (20:14 +0000)]
gl renderer: Generate queries only on desktop GL

On desktop GL, GL 1.5 or GL_ARB_occlusion_query is required to get the
glGenQueries() etc. symbols.  This isn’t the case on GLES, where they
are provided by GL_EXT_occlusion_query_boolean, and more importantly
have never been made core.

This patch allows gtk4-demo to start when GDK_DEBUG=gl-gles is set, on
my Mali 400 MP running the Lima driver from Mesa.

5 years agodocs: include GtkFilterMatch
David Lechner [Sat, 7 Nov 2020 20:45:41 +0000 (20:45 +0000)]
docs: include GtkFilterMatch

The GtkFilterMatch enum type was missing from the documentation.

5 years agoMerge branch 'dlech-master-patch-13962' into 'master'
Timm Bäder [Sat, 7 Nov 2020 18:47:55 +0000 (18:47 +0000)]
Merge branch 'dlech-master-patch-13962' into 'master'

gtk/enums: fix doc comment references

See merge request GNOME/gtk!2791

5 years agogtk/enums: fix doc comment references
David Lechner [Sat, 7 Nov 2020 17:46:26 +0000 (17:46 +0000)]
gtk/enums: fix doc comment references

Enum members need a "%" prefix rather than "@" or "%@" in order to
automatically create links in the documentation.

5 years agoFix tests with regard to GtkBuilder <requires>.
Arnaud Bonatti [Sat, 7 Nov 2020 15:13:47 +0000 (16:13 +0100)]
Fix tests with regard to GtkBuilder <requires>.

5 years agoDocument the GtkBuilder <requires> tag changes.
Arnaud Bonatti [Sat, 7 Nov 2020 13:10:41 +0000 (14:10 +0100)]
Document the GtkBuilder <requires> tag changes.

5 years agoTeach `gtk-builder-tool` to rewrite <requires>.
Arnaud Bonatti [Sat, 7 Nov 2020 10:24:19 +0000 (11:24 +0100)]
Teach `gtk-builder-tool` to rewrite <requires>.

5 years agoDrop “gtk+” plus sign in GtkBuilder <requires>.
Arnaud Bonatti [Sat, 7 Nov 2020 10:03:52 +0000 (11:03 +0100)]
Drop “gtk+” plus sign in GtkBuilder <requires>.

5 years agoUpdate POTFILES.skip
Piotr Drąg [Sat, 7 Nov 2020 10:45:07 +0000 (11:45 +0100)]
Update POTFILES.skip

5 years agoMerge branch 'wip/carlosg/for-master' into 'master'
Matthias Clasen [Sat, 7 Nov 2020 03:10:27 +0000 (03:10 +0000)]
Merge branch 'wip/carlosg/for-master' into 'master'

Minor text handle fixes

See merge request GNOME/gtk!2787

5 years agogtk/textview: Improve check for cursor-mode
Carlos Garnacho [Fri, 6 Nov 2020 13:30:18 +0000 (14:30 +0100)]
gtk/textview: Improve check for cursor-mode

Check the text handle role, instead of looking for the other handle
visibility. The other handle may be invisible during selection mode
(e.g. pointing to offscreen contents). This fixes both this code
switching to cursor mode out of the blue, and possible crashes later
on as this handle might be hidden in the process, while its own event
controller is handling events on the parent surface.

5 years agogtk/texthandle: Point handle to the middle of the pointing_to rect
Carlos Garnacho [Fri, 6 Nov 2020 13:28:46 +0000 (14:28 +0100)]
gtk/texthandle: Point handle to the middle of the pointing_to rect

At least vertically, this gives again as much space up and down before
moving the selection the the prev/next line.

5 years agoMerge branch 'wip/carlosg/for-master' into 'master'
Matthias Clasen [Fri, 6 Nov 2020 01:23:16 +0000 (01:23 +0000)]
Merge branch 'wip/carlosg/for-master' into 'master'

Text handle fixes

Closes #3176

See merge request GNOME/gtk!2785

5 years agoMerge branch 'wip/chergert/gdk-macos-for-master' into 'master'
Matthias Clasen [Fri, 6 Nov 2020 01:20:23 +0000 (01:20 +0000)]
Merge branch 'wip/chergert/gdk-macos-for-master' into 'master'

macos: tweak opacity, color/alpha size requests

See merge request GNOME/gtk!2786

5 years agomacos: use NSOpenGLContext directly for current tracking
Christian Hergert [Thu, 5 Nov 2020 21:57:41 +0000 (13:57 -0800)]
macos: use NSOpenGLContext directly for current tracking

We don't need to interact with GdkGLContext here to keep the
current context active.

5 years agomacos: explicitly request color and alpha sizes
Christian Hergert [Thu, 5 Nov 2020 21:37:25 +0000 (13:37 -0800)]
macos: explicitly request color and alpha sizes

5 years agomacos: use opaque GL context when possible
Christian Hergert [Thu, 5 Nov 2020 21:34:29 +0000 (13:34 -0800)]
macos: use opaque GL context when possible

This is better for situations where the window is decorated and therefore we can
rely on window system clipping of rounded corners.

5 years agogtk/textview: Do not forcibly show text handles
Carlos Garnacho [Thu, 5 Nov 2020 20:15:47 +0000 (21:15 +0100)]
gtk/textview: Do not forcibly show text handles

The gtk_text_view_set_handle_position() function called some lines above
takes care of handle visibility already, also accounting for other
conditions (e.g. whether the handle points to contents onscreen).
Forcibly showing handles here misbehaves if the handle should stay hidden,
and somewhat expensively as it involves creating and throwing a native
surface every time.

5 years agogtk/textview: Defer touchscreen focus placing to drag end
Carlos Garnacho [Thu, 5 Nov 2020 20:07:54 +0000 (21:07 +0100)]
gtk/textview: Defer touchscreen focus placing to drag end

With the scrolledwindow drag gesture not claiming the sequence immediately,
we end up placing the cursor (and undoing the previous selection) each time
we scroll.

There is already handling too short drags in ::drag-end, so let this code
handle touchscreens as well.

5 years agogtk/textview: Clean up further if the drag gesture is taken over
Carlos Garnacho [Thu, 5 Nov 2020 20:05:18 +0000 (21:05 +0100)]
gtk/textview: Clean up further if the drag gesture is taken over

If the gesture becomes captured (e.g. from a parent scrolledwindow), we
leave some things in the air. Clean these up properly. This is recurrent
with touch scroll.

5 years agogtk/imcontextwayland: Unset focus when unsetting widget
Carlos Garnacho [Thu, 5 Nov 2020 15:00:29 +0000 (16:00 +0100)]
gtk/imcontextwayland: Unset focus when unsetting widget

In destruction paths of a focused entry, the IM context might first
end up detached from its widget, then destroyed. This currently prevents
the IM context from detaching itself from the GtkIMContextWaylandGlobal.

Make it do so when unsetting the client widget, so the IM context gets
properly unfocused before destruction.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3176
5 years agogtk/texthandle: Handle events on parent surface's native
Carlos Garnacho [Thu, 5 Nov 2020 14:11:09 +0000 (15:11 +0100)]
gtk/texthandle: Handle events on parent surface's native

In wayland, popup positioning and event handling are doubly async.
This makes it unreliable to figure out parent surface coordinates
out of the popup position and the events received. This results in
jumpy text handles there.

The best way to deal with parent surface coordinates is to handle
the events there. Make the handles transparent to input, and make
the drag gesture be set up on the parent widget's native.

The gesture is set up in the capture phase, setting it on the native
(as opposed to the parent widget) achieves a feeling similar to it
being a distinct surface, as it should take precedence over other
gestures in the emission chain (e.g. scrolledwindows).

As everything is in parent widget's native's coordinates, the drag
handles become smooth again.

5 years agogdk/wayland: Ensure to update input area on map
Carlos Garnacho [Thu, 5 Nov 2020 14:09:35 +0000 (15:09 +0100)]
gdk/wayland: Ensure to update input area on map

If a surface is hidden, then shown again, it should preserve the
input area specified. Make sure that happens.

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Thu, 5 Nov 2020 16:43:08 +0000 (16:43 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

Closes #3325

See merge request GNOME/gtk!2784

5 years agoMerge branch 'ebassi/for-master' into 'master'
Emmanuele Bassi [Thu, 5 Nov 2020 15:37:38 +0000 (15:37 +0000)]
Merge branch 'ebassi/for-master' into 'master'

Ebassi/for master

See merge request GNOME/gtk!2783

5 years agodocs: Add a note on the "presentation" role
Emmanuele Bassi [Thu, 5 Nov 2020 14:50:40 +0000 (14:50 +0000)]
docs: Add a note on the "presentation" role

5 years agodocs: Add a section on accessible buttons
Emmanuele Bassi [Thu, 5 Nov 2020 13:57:50 +0000 (13:57 +0000)]
docs: Add a section on accessible buttons

Anything that behaves like a button should do so at the accessibility
level as well.

5 years agoa11y: Use proper role and state for tree expander image
Emmanuele Bassi [Thu, 5 Nov 2020 13:46:43 +0000 (13:46 +0000)]
a11y: Use proper role and state for tree expander image

The "expander" image is a button, and it controls the expansion of the
row, so it has a state associated to it that we must update.

5 years agoa11y: Use "presentation" role instead of "hidden" state
Emmanuele Bassi [Thu, 5 Nov 2020 13:19:26 +0000 (13:19 +0000)]
a11y: Use "presentation" role instead of "hidden" state

The intended use case of the "presentation" role is

| […] when an element is used to change the look of the page but does not
| have all the functional, interactive, or structural relevance implied
| by the element type, or may be used to provide for an accessible
| fallback in older browsers that do not support WAI-ARIA.

One of the examples is, literally:

| An element whose content is completely presentational (like a spacer
| image, decorative graphic, or clearing element);

Which fits perfectly for the GtkTreeExpander's "indent" builtin icon
widget.

5 years agoa11y: ARIA's "presentation" role maps to ATSPI_ROLE_SECTION
Emmanuele Bassi [Thu, 5 Nov 2020 13:14:08 +0000 (13:14 +0000)]
a11y: ARIA's "presentation" role maps to ATSPI_ROLE_SECTION

See the mapping role table in the Core-AAM normative document:

https://w3c.github.io/core-aam/#mapping_role_table

5 years agodragicon: Make a function propertly exported
Matthias Clasen [Thu, 5 Nov 2020 12:23:38 +0000 (07:23 -0500)]
dragicon: Make a function propertly exported

Mark gtk_drag_icon_create_widget_for_value with
GDK_AVAILABLE_IN_ALL, since it is meant to be public.
Also, clarify the documentation a bit.

Fixes: #3325
5 years agoCosmetics
Matthias Clasen [Thu, 5 Nov 2020 04:35:01 +0000 (23:35 -0500)]
Cosmetics

Fix argument ordering of gdk_cursor_new_from_name.

5 years agotestsuite: Improve GdkCursor coverage
Matthias Clasen [Thu, 5 Nov 2020 04:34:36 +0000 (23:34 -0500)]
testsuite: Improve GdkCursor coverage

5 years ago3.99.4
Matthias Clasen [Thu, 5 Nov 2020 02:46:10 +0000 (21:46 -0500)]
3.99.4

5 years agoMerge branch 'wip/chergert/gdk-macos-gl-renderer' into 'master'
Matthias Clasen [Thu, 5 Nov 2020 02:21:02 +0000 (02:21 +0000)]
Merge branch 'wip/chergert/gdk-macos-gl-renderer' into 'master'

macos: gl context improvements and event cleanup

See merge request GNOME/gtk!2780

5 years agoMerge branch 'wip/chergert/fix-macos-pointer-position-over-surface' into 'master'
Matthias Clasen [Thu, 5 Nov 2020 02:19:18 +0000 (02:19 +0000)]
Merge branch 'wip/chergert/fix-macos-pointer-position-over-surface' into 'master'

macos: fix calculation of mouse position

See merge request GNOME/gtk!2781